<script setup lang="ts">
import { createTextVNode, defineComponent } from 'vue';
import { useDialog, useLoadingBar, useMessage, useNotification } from 'naive-ui';

defineOptions({
  name: 'AppProvider'
});
const ContentHolder = defineComponent({
  name: 'ContentHolder',
  setup() {
    function register() {
      window.$loadingBar = useLoadingBar();
      window.$dialog = useDialog();
      window.$message = useMessage();
      window.$notification = useNotification();
    }
    register();

    return () => createTextVNode();
  }
})
</script>

<template>
<NLoadingBarProvider>
  <NDialogProvider>
    <NNotificationProvider>
      <NMessageProvider>
        <ContentHolder />
        <slot></slot>
      </NMessageProvider>
    </NNotificationProvider>
  </NDialogProvider>
</NLoadingBarProvider>
</template>

<style scoped>

</style>
